package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-02-22
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_device_info")
@ApiModel(value = "CustomerDeviceInfo", description = "")
@AllArgsConstructor
public class CustomerDeviceInfo extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @TableField("customer_id")
    @Excel(name = "用户ID")
    private Long customerId;

    /**
     * 登录IP
     */
    @ApiModelProperty(value = "登录IP")
    @Length(max = 255, message = "登录IP长度不能超过255")
    @TableField(value = "login_ip", condition = LIKE)
    @Excel(name = "登录IP")
    private String loginIp;

    /**
     * 省份
     */
    @ApiModelProperty(value = "省份")
    @Length(max = 255, message = "省份长度不能超过255")
    @TableField(value = "prov", condition = LIKE)
    @Excel(name = "省份")
    private String prov;

    /**
     * 市区
     */
    @ApiModelProperty(value = "市区")
    @Length(max = 255, message = "市区长度不能超过255")
    @TableField(value = "city", condition = LIKE)
    @Excel(name = "市区")
    private String city;

    /**
     * 区
     */
    @ApiModelProperty(value = "区")
    @Length(max = 255, message = "区长度不能超过255")
    @TableField(value = "area", condition = LIKE)
    @Excel(name = "区")
    private String area;

    /**
     * 国家
     */
    @ApiModelProperty(value = "国家")
    @Length(max = 255, message = "国家长度不能超过255")
    @TableField(value = "country", condition = LIKE)
    @Excel(name = "国家")
    private String country;

    /**
     * 纬度
     */
    @ApiModelProperty(value = "纬度")
    @Length(max = 255, message = "纬度长度不能超过255")
    @TableField(value = "lat", condition = LIKE)
    @Excel(name = "纬度")
    private String lat;

    /**
     * 经度
     */
    @ApiModelProperty(value = "经度")
    @Length(max = 255, message = "经度长度不能超过255")
    @TableField(value = "lng", condition = LIKE)
    @Excel(name = "经度")
    private String lng;


    @Builder
    public CustomerDeviceInfo(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    Long customerId, String loginIp, String prov, String city, String area, 
                    String country, String lat, String lng) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.customerId = customerId;
        this.loginIp = loginIp;
        this.prov = prov;
        this.city = city;
        this.area = area;
        this.country = country;
        this.lat = lat;
        this.lng = lng;
    }

}
